@extends('layouts.app')

@section('title', $user->name . ' 的个人中心')
@section('styles')
  <link href="/static/layuiadmin/style/template.css" rel="stylesheet">
  <link href="/static/layuiadmin/style/template.css" rel="stylesheet">
  <link href="/static/fontawesome/css/all.min.css" rel="stylesheet">
@endsection

@section('content')
<div class="layui-fluid layadmin-homepage-fluid">
  <div class="layui-row layui-col-space8 layadmin-caller">
    <div class="layui-col-md2">
      <div class="layadmin-homepage-panel layadmin-homepage-shadow">
        <div class="layui-card text-center">
          <div class="layui-card-body">
            <div class="layadmin-homepage-pad-ver">
              <img class="layadmin-homepage-pad-img" src="{{$user->avatar}}" width="96" height="96">
            </div>
            <h4 class="layadmin-homepage-font">{{$user->name}}</h4>
            <p class="layadmin-homepage-min-font">管理员</p>
            <button class="layui-btn layui-btn-fluid">关注</button>
          </div>
        </div>
        <p class="layadmin-homepage-about">
          个人简介
        </p>
        <div class="layadmin-homepage-pad-hor">
          <mdall>{{$user->introduction}}</mdall>
        </div>
        <p class="layadmin-homepage-about">
          注册于<br>{{ $user->created_at->diffForHumans() }}
        </p>
      </div>
    </div>
    <div class="layui-col-md10">
      <div class="layui-row layui-col-space20 layadmin-homepage-list-imgtxt">
          <div class="layui-col-md9 layui-col-space20">
            <div class="layui-tab layui-tab-brief caller-tab" lay-filter="docDemoTabBrief">
              <ul class="layui-tab-title">
                <li class="{{ active_class( !if_query('tab', 'replies'), 'layui-this') }}"><a href="{{ Request::url() }}?tab=topics">Ta的话题</a></li>
                <li class="{{ active_class( if_query('tab', 'replies'), 'layui-this') }}"><a href="{{ Request::url() }}?tab=replies">Ta的回复</a></li>
              </ul>
            </div>
            <div class="caller-contar">
              @if (if_query('tab', 'replies'))
                @foreach($replies as $reply)
                  @include('users._reply_list_item', ['reply'=>$reply])
                @endforeach
              @else
                @foreach($topics as $topic)
                  @include('users._topic_item', ['topic'=>$topic])
                @endforeach
              @endif
              <div id="user-topic-pages"></div>
            </div>
          </div>
        </div>
      </div>

    </div>
  </div>
</div>

@endsection
